package 笔试.网易;

import java.util.*;
public class Demo1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        int M = in.nextInt();
        int count = 0;
        String[] arr = str.split("\\s+");
        int[] nums = new int[arr.length];
        for(int i=0;i<arr.length;i++){
            nums[i] = Integer.valueOf(arr[i]);
        }
        for(int i=0;i<nums.length;i++){
            for(int j=i+1;j<nums.length;j++){
                if(nums[i]+nums[j]<=M){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}
